package com.sinocare.system.service.Impl;

import com.sinocare.common.entity.Menu;
import com.sinocare.common.entity.Role;
import com.sinocare.common.entity.RoleMenu;
import com.sinocare.system.mapper.RoleMapper;
import com.sinocare.system.service.RoleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class RoleServiceImpl implements RoleService {
    @Resource
    private RoleMapper roleMapper;

    @Override
    public List<Role> query(Role role) {
        return roleMapper.query(role);
    }

    @Override
    public int add(Role role) {
        return roleMapper.add(role);
    }

    @Override
    public int update(Role role) {
        return roleMapper.update(role);
    }

    @Override
    public List<RoleMenu> listRoleMenu(Integer id) {
        return roleMapper.listRoleMenu(id);
    }

    @Override
    public List<Menu> listRole() {
        return roleMapper.listRole();
    }

    @Override
    public List<Menu> listMenu(Integer id) {
        return roleMapper.listMenu(id);
    }

    @Override
    public int deleteRole(Integer id) {
        return roleMapper.deleteRole(id);
    }

    @Override
    public int addRole(List<Map<String,Integer>> list) {
        return roleMapper.addRole(list);
    }
}
